<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//验证码
Route::get('/verify',                   'HomeController@verify');
//登陆模块
Route::group(['namespace'  => "Auth"], function () {
    Route::get('/login',                'LoginController@showLoginForm')->name('login');
    Route::post('/login',               'LoginController@login');
    Route::get('/logout',               'LoginController@logout')->name('logout');
});
//后台主要模块
Route::group(['middleware' => ['auth', 'permission']], function () {
    Route::get('/',                     'HomeController@index');
    Route::get('/gewt',                 'HomeController@configr');
    Route::get('/index',                'HomeController@welcome');
    Route::post('/sort',                'HomeController@changeSort');
    Route::resource('/menus',           'MenuController');
    Route::resource('/logs',            'LogController');
    Route::resource('/users',           'UserController');
    Route::get('/userinfo',             'UserController@userInfo');
    Route::post('/saveinfo/{type}',     'UserController@saveInfo');
    Route::resource('/roles',           'RoleController');
    Route::resource('/permissions',     'PermissionController');
    //会员管理
    Route::resource('/member',           'MemberController');
    //旅行社管理
    Route::resource('agency',           'AgencyController');
    //菜单列表
    Route::resource('/amenu',           'AgencyMenuController');
    Route::get('/amenu',           'AgencyMenuController@index');
    Route::get('/amenue/{id}',           'AgencyMenuController@edit');
    Route::post('/amenues',           'AgencyMenuController@save');

    //内容
    Route::resource('/content',           'ContentConroller');
    Route::post('/content/upload',           'ContentConroller@upload');
    //供应商登录体系
    Route::group(['namespace'  => "Supplier"], function () {
        Route::post('/supplier', 'SupplierController@index');
    }
    );


});
//手机接口
Route::group(['namespace'  => "Wap"], function () {
    Route::get('/wap/index',                'IndexController@index');
    Route::get('/wap/content','IndexController@content');
    Route::get('/wap/lists','IndexController@lists');
    Route::get('/wap/register','IndexController@register');
    Route::get('/wap/upload','IndexController@upload');
    Route::get('/wap/generate','IndexController@generate');
    Route::get('/wap/getimg','IndexController@getImg');
});
